<% if item.reviews.empty? %>
  No one has written a review for this artist. Care to write one?
<% end %>

<% if permitted_to? :new, :reviews %>
  <strong>
  <%= link_to 'Write a Review', 
              new_review_path(:reviewable_id => item.id,
                              :reviewable_type => item.class.to_s),
              :class => 'lightwindow',
              :params => 'lightwindow_type=page,lightwindow_width=600,lightwindow_height=400' %>
  </strong>
  <br /><br />
<% end %>

<% item.reviews.each do |review| %>

<div class="review">

  <div class="review-title">
    <strong><%=h review.title %></strong><br />
  </div>

  <div class="review-author">
    by: <%= link_to review.user.username, user_path(review.user) %>
    on <%= review.created_at.strftime('%d-%m-%y') %>
    <br /><br />
  </div>

  <div class="review-body"> 
    <%=h review.review %>
    <br />
  </div>

  <% if permitted_to? :edit, :reviews %>
    <%= link_to 'Edit', edit_review_path(review),
                        :class => 'lightwindow',
                        :params => 'lightwindow_type=page,lightwindow_width=600,lightwindow_height=400'	%>
  <% end %>
  <% if permitted_to? :destroy, :reviews %>
    | <%= link_to 'Delete', review_path(review), :method => :delete %>
  <% end %>

</div>
<% end %>

